// 登录功能，只需要存储 token 即可，所以，状态默认值为：''
const initialState = localStorage.getItem('geek-pc-token') || '';

const login = (state = initialState, action) => {
  switch (action.type) {
    case 'login/token':
      return action.payload;
    case 'login/clearToken':
      return '';
    default:
      return state;
  }
};

export { login };
